<template>
	 <view id="body"> 
		<indexPlacard v-if="flage"></indexPlacard>
		<indexCarousel v-if="flage"></indexCarousel>
		<indexclassify v-if="flage"></indexclassify>
		<view style="width: 696rpx;margin: 0 auto;">
			<indexGoodContent  v-if="flage"></indexGoodContent>
		</view>
		<indexOrderCenter  v-if="flage"></indexOrderCenter>
	</view>
</template>
<script> 
	import indexclassify from 'index/indexClassify'
	import indexPlacard from 'index/indexPlacard'  
	import indexCarousel from "index/indexCarousel"  
	import indexGoodContent from "index/indexGoodContent"
	import indexOrderCenter from "index/indexOrderCenter"
	export default {
		//注册组件
		components:{
			indexclassify,
			indexPlacard,
			indexCarousel,
			indexGoodContent,
			indexOrderCenter
		},
		data() {
			return {
				flage:true
			}
		},
		onPullDownRefresh() {
			console.log('触发了下拉刷新')
			this.flage = false
			this.flage = false
			this.$nextTick(() => (this.flage = true))
			
		},
		// 上拉加载
		onReachBottom() {
			console.log('触发了上拉加载')
			// this.orderList = this.orderList.concat(list)//加载数据
		},
		onShow() {
			var num = uni.getStorageSync("tabbar")
				if(num > 0){
					uni.setTabBarBadge({ //显示数字 
						index: 1, //tabbar下标
						text:""+num,//数字
						success() {
						console.log("设置成功") 
						},
						fail(e){ 
						   console.log("设置失败"+JSON.stringify(e))
						}
					})
				}
		},
		methods: {
			 
		},
		options:{
			styleIsolation:"shared"
		}
	}
</script>

<style scoped>
	@import url("../static/css/componentsCss/index/index.css");
	page {
		background-color: #f5f5f5;
	}
</style>
